/*
 * Singularity Engine
 * Copyright (C) 2010 Vyacheslav Vorobyov, All rights reserved.
 * See LICENSE for full license information.
 */

/**
 * 
 */
package org.singularity.mapred.util;

import java.util.List;

import org.singularity.io.DME;
import org.singularity.io.Pipe;
import org.singularity.mapred.MapFun;
import org.singularity.mapred.VDME;

/**
 * @author vjache
 *
 */
public class ListMapFun<T> implements MapFun<List<T>,T, List<T>> {

	private final int _keyPos;
	public ListMapFun(int aKeyPos)
	{
		_keyPos = aKeyPos;
	}
	
	@Override
	public void map(DME<List<T>> aInput,
			Pipe<VDME<T, List<T>>> aOutput) throws Exception {
		aOutput.push(new ListVDME<T>(aInput, _keyPos));
	}

}
